{extend name='admin@main'}

{block name="content"}

{include file='store@goods/form_style'}

<form onsubmit="return false;" id="GoodsForm" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
<div class="layui-card-body think-box-shadow padding-left-40">
  <div class="layui-form-item">
    <label class="layui-form-label">商品名称</label>
    <div class="layui-input-block">
      <input name="name" lay-verify="name" value="{$result.name}" autocomplete="off" placeholder="请输入商品名称" class="layui-input" type="text">
    </div>
  </div>
    <div class="layui-form-item ">
      
      <div class="layui-inline">
        <label class="layui-form-label">商品类型</label>
        <div class="layui-input-inline">
         <select class="layui-select"  name="tid" lay-search>
            <option value="" selected="selected">请选择商品类型</option>
              {foreach $marktype as $marktype}
              {if  $result.tid eq $marktype.id}
              <option selected value="{$marktype.id}">{$marktype.name}</option>
              {else}
              <option value="{$marktype.id}">{$marktype.name}</option>
              {/if}
            {/foreach}
            </select>
        </div>
      </div>

      <div class="layui-inline">
        <label class="layui-form-label">商品原价</label>
        <div class="layui-input-inline">
          <input name="oprice" lay-verify="oprice" value="{$result.oprice}" autocomplete="off" class="layui-input" type="text">
        </div>
      </div>
      <div class="layui-inline">
        <label class="layui-form-label">商品卖价</label>
        <div class="layui-input-inline">
          <input name="money" lay-verify="money" value="{$result.money}" autocomplete="off" class="layui-input" type="text">
        </div>
      </div>
      <div class="layui-inline">
        <label class="layui-form-label">联系人</label>
        <div class="layui-input-inline">
          <input name="contacts" lay-verify="contacts" value="{$result.contacts}" autocomplete="off" class="layui-input" type="text">
        </div>
      </div>
      <div class="layui-inline">
        <label class="layui-form-label">联系电话</label>
        <div class="layui-input-inline">
          <input name="mobile" lay-verify="mobile" value="{$result.mobile}" autocomplete="off" class="layui-input" type="text">
        </div>
      </div>

    </div>

    <div class="layui-form-item ">

      <div class="layui-inline">
        <label class="layui-form-label">商品数量</label>
        <div class="layui-input-inline">
          <input name="number" lay-verify="number" value="{$result.number|default=''}" placeholder="请输入商品数量" autocomplete="off" class="layui-input" type="number">
        </div>
      </div>
      <div class="layui-inline">
        <label class="layui-form-label" >所在省份:</label>
        <div class="layui-input-inline" >
          <input name="province" placeholder="" readonly="readonly"  value="{$address.province}"  autocomplete="off" class="layui-input" type="text">
        </div>
      </div>

      <div class="layui-inline">
        <label class="layui-form-label" >所在城市:</label>
        <div class="layui-input-inline" >
          <input name="city" placeholder=""  readonly="readonly"  value="{$address.city}"  autocomplete="off" class="layui-input" type="text">
        </div>
      </div>

      <div class="layui-inline">
        <label class="layui-form-label" >所在县区:</label>
        <div class="layui-input-inline" >
          <select name="county_id" class="county-selector" data-value="{$vo.countyName|default=''}" >
           {foreach $county as $vo} 
           {if  $result.county_id eq $vo.area_id}
           <option selected value="{$vo.area_id}">{$vo.area_name}</option>
              {else}
            <option value="{$vo.area_id}">{$vo.area_name}</option>
            {/if}
          {/foreach}
          </select>
        </div>
      </div>
    <div class="layui-inline">
      <label class="layui-form-label">详细地址</label>
      <div class="layui-input-inline">
        <input name="address" lay-verify="address" value="{$result.address}" autocomplete="off" class="layui-input" type="text">
      </div>
    </div>
   

    </div>

    <div class="layui-form-item ">

      <div class="layui-inline">
      <label class="layui-form-label">商品成色</label>
      <div class="layui-input-inline">
        <input name="depreciation" lay-verify="depreciation" value="{$result.depreciation}" placeholder="请输入商品成色" autocomplete="off" class="layui-input" type="text">
      </div>
    </div>
    <div class="layui-inline">
      <label class="layui-form-label">微信号</label>
      <div class="layui-input-inline">
        <input name="wechat_num" lay-verify="wechat_num" value="{$result.wechat_num}" placeholder="请输入微信号" autocomplete="off" class="layui-input" type="text">
      </div>
    </div>
    <div class="layui-inline">
      <label class="layui-form-label">QQ号</label>
      <div class="layui-input-inline">
        <input name="qq_num" lay-verify="qq_num" value="{$result.qq_num}" placeholder="请输入QQ号" autocomplete="off" class="layui-input" type="text">
      </div>
    </div>

       <div class="layui-inline">
        <label class="layui-form-label">是否上架</label>
        <div class="layui-input-block">
          <input name="is_show" value="1" title="是" {eq name='$result.is_show' value='1'} checked {/eq} type="radio">
          <input name="is_show" value="0" title="否" {eq name='$result.is_show' value='0'} checked {/eq} type="radio">
        </div>
      </div>
      <div class="layui-inline">
        <label class="layui-form-label">是否置顶</label>
        <div class="layui-input-block">
          <input name="top" value="1" title="是" {eq name='$result.top' value='1'} checked {/eq} type="radio">
          <input name="top" value="0" title="否" {eq name='$result.top' value='0'} checked {/eq} type="radio">
        </div>
      </div>

    </div>
      <div class="layui-form-item">
      <label class="layui-form-label">商品LOGO及展示图片</label>
      <table class="layui-table " style="width: 80%;">
          <thead>
          <tr>
              <th class="text-center">LOGO</th>
              <th class="text-left">展示图片</th>
          </tr>
          <tr style="background-color: #ffff;">
              <td width="90px" class="text-center"><input name="logo" type="hidden" value="{$result.logo|default=''}"></td>
              <td width="auto" class="text-left"><input name="image" type="hidden" value="{$result.image|default=''}"></td>
          </tr>
          </thead>
      </table>
      <script>$('[name="logo"]').uploadOneImage(), $('[name="image"]').uploadMultipleImage()</script>
    </div>
    <div class="layui-form-item ">
       <label class="layui-form-label">商品详情</label>
      <div class="layui-inline">
           
            <textarea rows="8" cols="150" name="content">{$result.content|default=''}</textarea>
      </div>
    </div>
    
    <div class="layui-form-item ">
        {eq name='$result.type' value='1'}
        <input type="hidden" name="id" value="{$result.id}">
        <input type="hidden" name="mid" value="{$result.markid}">
        <button class="layui-btn layui-btn-sm" type="submit">保存商品</button>
        {/eq}
        {if agent_auth("auditMarket")}
          {eq name='$result.status' value='2'}
           <a class="layui-btn layui-btn-sm layui-btn-normal" data-action="{:url('auditMarket')}" data-value="id#{$result.id};status#3">审核通过</a>

           <a data-title="审核拒绝" class="layui-btn layui-btn-sm layui-btn-danger" data-modal='{:url("deny")}?id={$result.id}'>审核拒绝</a>
          
          {/eq}
        {/if}
    </div>
</div>
</form>
{/block}

{block name='script'}

<script>
  window.form.render();
  layui.use('laydate', function(){
    var laydate = layui.laydate;
    //常规用法
    laydate.render({
      elem: '#test1'
    });
    laydate.render({
      elem: '#test2'
    });
    
  });

   require(['ckeditor', 'angular'], function () {
     window.createEditor('[name="content1"]', {height: 200});
   });
</script>

{/block}